// ****************************************************************************** 
// Copyright     :  Copyright (C) 2018, Hisilicon Technologies Co. Ltd.
// File name     :  system_counter_c_union_define.h
// Project line  :  ICT
// Department    :  ICT Processor Chipset Development Dep
// Author        :  Huawei
// Version       :  1.0
// Date          :  2015/11/15
// Description   :  The description of Totem
// Others        :  Generated automatically by nManager V4.2 
// History       :  Huawei 2018/04/10 11:44:20 Create file
// ******************************************************************************

#ifndef __SYSTEM_COUNTER_C_UNION_DEFINE_H__
#define __SYSTEM_COUNTER_C_UNION_DEFINE_H__

/* Define the union U_CNTCR */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_0 : 30  ; /* [31:2] */
        unsigned int    hdbg  : 1  ; /* [1] */
        unsigned int    en    : 1  ; /* [0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CNTCR;

/* Define the union U_CNTSR */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_1 : 30  ; /* [31:2] */
        unsigned int    dbgh  : 1  ; /* [1] */
        unsigned int    rsv_2 : 1  ; /* [0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CNTSR;

/* Define the union U_CNTCVL */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    cntcvl_l_32 : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CNTCVL;

/* Define the union U_CNTCVU */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    cntcvu_u_32 : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CNTCVU;

/* Define the union U_CNTFID0 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    freq : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CNTFID0;

/* Define the union U_PIDR4 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_3 : 24  ; /* [31:8] */
        unsigned int    size  : 4  ; /* [7:4] */
        unsigned int    des_2 : 4  ; /* [3:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PIDR4;

/* Define the union U_PIDR5 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_4 : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PIDR5;

/* Define the union U_PIDR6 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_5 : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PIDR6;

/* Define the union U_PIDR7 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_6 : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PIDR7;

/* Define the union U_PIDR0 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_7  : 24  ; /* [31:8] */
        unsigned int    part_0 : 8  ; /* [7:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PIDR0;

/* Define the union U_PIDR1 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_8  : 24  ; /* [31:8] */
        unsigned int    des_0  : 4  ; /* [7:4] */
        unsigned int    part_1 : 4  ; /* [3:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PIDR1;

/* Define the union U_PIDR2 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_9    : 24  ; /* [31:8] */
        unsigned int    revision : 4  ; /* [7:4] */
        unsigned int    jedec    : 1  ; /* [3] */
        unsigned int    des_1    : 3  ; /* [2:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PIDR2;

/* Define the union U_PIDR3 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_10 : 24  ; /* [31:8] */
        unsigned int    revand : 4  ; /* [7:4] */
        unsigned int    cmod   : 4  ; /* [3:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PIDR3;

/* Define the union U_CIDR0 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_11  : 24  ; /* [31:8] */
        unsigned int    prmbl_0 : 8  ; /* [7:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CIDR0;

/* Define the union U_CIDR1 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_12  : 24  ; /* [31:8] */
        unsigned int    class   : 4  ; /* [7:4] */
        unsigned int    prmbl_1 : 4  ; /* [3:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CIDR1;

/* Define the union U_CIDR2 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_13  : 24  ; /* [31:8] */
        unsigned int    prmbl_2 : 8  ; /* [7:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CIDR2;

/* Define the union U_CIDR3 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_14  : 24  ; /* [31:8] */
        unsigned int    prmbl_3 : 8  ; /* [7:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CIDR3;

/* Define the union U_CNTCVL(RO) */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    cntcvl_l_32 : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CNTCVL(RO);

/* Define the union U_CNTCVU(RO) */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    cntcvu_u_32 : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CNTCVU(RO);

/* Define the union U_PIDR4(RO) */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_15 : 24  ; /* [31:8] */
        unsigned int    size   : 4  ; /* [7:4] */
        unsigned int    des_2  : 4  ; /* [3:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PIDR4(RO);

/* Define the union U_PIDR5(RO) */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_16 : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PIDR5(RO);

/* Define the union U_PIDR6(RO) */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_17 : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PIDR6(RO);

/* Define the union U_PIDR7(RO) */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_18 : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PIDR7(RO);

/* Define the union U_PIDR0(RO) */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_19 : 24  ; /* [31:8] */
        unsigned int    part_0 : 8  ; /* [7:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PIDR0(RO);

/* Define the union U_PIDR1(RO) */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_20 : 24  ; /* [31:8] */
        unsigned int    des_0  : 4  ; /* [7:4] */
        unsigned int    part_1 : 4  ; /* [3:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PIDR1(RO);

/* Define the union U_PIDR2(RO) */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_21   : 24  ; /* [31:8] */
        unsigned int    revision : 4  ; /* [7:4] */
        unsigned int    jedec    : 1  ; /* [3] */
        unsigned int    des_1    : 3  ; /* [2:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PIDR2(RO);

/* Define the union U_PIDR3(RO) */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_22 : 24  ; /* [31:8] */
        unsigned int    revand : 4  ; /* [7:4] */
        unsigned int    cmod   : 4  ; /* [3:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PIDR3(RO);

/* Define the union U_CIDR0(RO) */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_23  : 24  ; /* [31:8] */
        unsigned int    prmbl_0 : 8  ; /* [7:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CIDR0(RO);

/* Define the union U_CIDR1(RO) */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_24  : 24  ; /* [31:8] */
        unsigned int    class   : 4  ; /* [7:4] */
        unsigned int    prmbl_1 : 4  ; /* [3:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CIDR1(RO);

/* Define the union U_CIDR2(RO) */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_25  : 24  ; /* [31:8] */
        unsigned int    prmbl_2 : 8  ; /* [7:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CIDR2(RO);

/* Define the union U_CIDR3(RO) */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_26  : 24  ; /* [31:8] */
        unsigned int    prmbl_3 : 8  ; /* [7:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CIDR3(RO);


//==============================================================================
/* Define the global struct */
typedef struct
{
    volatile U_CNTCR      CNTCR      ; /* 0 */
    volatile U_CNTSR      CNTSR      ; /* 4 */
    volatile U_CNTCVL     CNTCVL     ; /* 8 */
    volatile U_CNTCVU     CNTCVU     ; /* C */
    volatile U_CNTFID0    CNTFID0    ; /* 20 */
    volatile U_PIDR4      PIDR4      ; /* FD0 */
    volatile U_PIDR5      PIDR5      ; /* FD4 */
    volatile U_PIDR6      PIDR6      ; /* FD8 */
    volatile U_PIDR7      PIDR7      ; /* FDC */
    volatile U_PIDR0      PIDR0      ; /* FE0 */
    volatile U_PIDR1      PIDR1      ; /* FE4 */
    volatile U_PIDR2      PIDR2      ; /* FE8 */
    volatile U_PIDR3      PIDR3      ; /* FEC */
    volatile U_CIDR0      CIDR0      ; /* FF0 */
    volatile U_CIDR1      CIDR1      ; /* FF4 */
    volatile U_CIDR2      CIDR2      ; /* FF8 */
    volatile U_CIDR3      CIDR3      ; /* FFC */
    volatile U_CNTCVL(RO) CNTCVL(RO) ; /* 1000 */
    volatile U_CNTCVU(RO) CNTCVU(RO) ; /* 1004 */
    volatile U_PIDR4(RO)  PIDR4(RO)  ; /* FD0 */
    volatile U_PIDR5(RO)  PIDR5(RO)  ; /* FD4 */
    volatile U_PIDR6(RO)  PIDR6(RO)  ; /* FD8 */
    volatile U_PIDR7(RO)  PIDR7(RO)  ; /* FDC */
    volatile U_PIDR0(RO)  PIDR0(RO)  ; /* FE0 */
    volatile U_PIDR1(RO)  PIDR1(RO)  ; /* FE4 */
    volatile U_PIDR2(RO)  PIDR2(RO)  ; /* FE8 */
    volatile U_PIDR3(RO)  PIDR3(RO)  ; /* FEC */
    volatile U_CIDR0(RO)  CIDR0(RO)  ; /* FF0 */
    volatile U_CIDR1(RO)  CIDR1(RO)  ; /* FF4 */
    volatile U_CIDR2(RO)  CIDR2(RO)  ; /* FF8 */
    volatile U_CIDR3(RO)  CIDR3(RO)  ; /* FFC */

} S_system_counter_REGS_TYPE;

/* Declare the struct pointor of the module system_counter */
extern volatile S_system_counter_REGS_TYPE *gopsystem_counterAllReg;

/* Declare the functions that set the member value */
int iSetCNTCR_hdbg(unsigned int uhdbg);
int iSetCNTCR_en(unsigned int uen);
int iSetCNTSR_dbgh(unsigned int udbgh);
int iSetCNTCVL_cntcvl_l_32(unsigned int ucntcvl_l_32);
int iSetCNTCVU_cntcvu_u_32(unsigned int ucntcvu_u_32);
int iSetCNTFID0_freq(unsigned int ufreq);
int iSetPIDR4_size(unsigned int usize);
int iSetPIDR4_des_2(unsigned int udes_2);



int iSetPIDR0_part_0(unsigned int upart_0);
int iSetPIDR1_des_0(unsigned int udes_0);
int iSetPIDR1_part_1(unsigned int upart_1);
int iSetPIDR2_revision(unsigned int urevision);
int iSetPIDR2_jedec(unsigned int ujedec);
int iSetPIDR2_des_1(unsigned int udes_1);
int iSetPIDR3_revand(unsigned int urevand);
int iSetPIDR3_cmod(unsigned int ucmod);
int iSetCIDR0_prmbl_0(unsigned int uprmbl_0);
int iSetCIDR1_class(unsigned int uclass);
int iSetCIDR1_prmbl_1(unsigned int uprmbl_1);
int iSetCIDR2_prmbl_2(unsigned int uprmbl_2);
int iSetCIDR3_prmbl_3(unsigned int uprmbl_3);
int iSetCNTCVL(RO)_cntcvl_l_32(unsigned int ucntcvl_l_32);
int iSetCNTCVU(RO)_cntcvu_u_32(unsigned int ucntcvu_u_32);
int iSetPIDR4(RO)_size(unsigned int usize);
int iSetPIDR4(RO)_des_2(unsigned int udes_2);



int iSetPIDR0(RO)_part_0(unsigned int upart_0);
int iSetPIDR1(RO)_des_0(unsigned int udes_0);
int iSetPIDR1(RO)_part_1(unsigned int upart_1);
int iSetPIDR2(RO)_revision(unsigned int urevision);
int iSetPIDR2(RO)_jedec(unsigned int ujedec);
int iSetPIDR2(RO)_des_1(unsigned int udes_1);
int iSetPIDR3(RO)_revand(unsigned int urevand);
int iSetPIDR3(RO)_cmod(unsigned int ucmod);
int iSetCIDR0(RO)_prmbl_0(unsigned int uprmbl_0);
int iSetCIDR1(RO)_class(unsigned int uclass);
int iSetCIDR1(RO)_prmbl_1(unsigned int uprmbl_1);
int iSetCIDR2(RO)_prmbl_2(unsigned int uprmbl_2);
int iSetCIDR3(RO)_prmbl_3(unsigned int uprmbl_3);

#endif // __SYSTEM_COUNTER_C_UNION_DEFINE_H__
